#include <stdio.h>

static void test_str(void)
{
	char d[128] = {0};
	char s[] = "hello world";

	sscanf(s, "%[^\n]%*c", d);

	printf("d= %s\n", d);
}

static void test_int(void)
{
	int d = 0;
	char str[] = "-92";

	sscanf(str, "%d", &d);

	printf("%s: %d\n", __func__, d);
}

static void test_double(void)
{
	double d = 0;
	char str1[] = "9e10";
	int ret = 0;

	ret = sscanf(str1, "%lf", &d);

	printf("%s:ret(%d) %f\n", __func__, ret,  d);
}

int main(int argc, char **argv)
{
	test_int();
	test_double();
}
